package cn.iocoder.yudao.module.tms.dal.mysql.orderfollowlog;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.tms.dal.dataobject.orderfollowlog.OrderFollowLogDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.tms.controller.admin.orderfollowlog.vo.*;

/**
 * 订单跟进日志 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface OrderFollowLogMapper extends BaseMapperX<OrderFollowLogDO> {

    default PageResult<OrderFollowLogDO> selectPage(OrderFollowLogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<OrderFollowLogDO>()
                .eqIfPresent(OrderFollowLogDO::getCompanyId, reqVO.getCompanyId())
                .eqIfPresent(OrderFollowLogDO::getOrderId, reqVO.getOrderId())
                .betweenIfPresent(OrderFollowLogDO::getFollowTime, reqVO.getFollowTime())
                .eqIfPresent(OrderFollowLogDO::getFollower, reqVO.getFollower())
                .eqIfPresent(OrderFollowLogDO::getFollowContent, reqVO.getFollowContent())
                .eqIfPresent(OrderFollowLogDO::getProcessStatus, reqVO.getProcessStatus())
                .betweenIfPresent(OrderFollowLogDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(OrderFollowLogDO::getId));
    }

}